Skip to content

mcpx(ci): guard malformed e2e timing seeds - #7897

Merged
dezren39 merged 4 commits into
mainfrom
queue/11046-6822-e2e-seed-shape-guards
Nov 14, 2026
Merged

dezren39 merged 4 commits into
mainfrom
queue/11046-6822-e2e-seed-shape-guards

Conversation

@dezren39

@dezren39 dezren39 commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

Summary

load_weights now rejects non-object tests containers to equal weights with a named seed note, and skips invalid per-test weights (non-finite, non-positive, or boolean) by name.

Adds Python regression coverage for malformed containers, invalid weights, a well-formed seed, and the committed-seed matrix invocation. Refs #6822.

Evidence

  • Before: list/string tests fields raised AttributeError; Infinity caused OverflowError; true was accepted as 1.0s.
  • After: python3 -m unittest discover -s pkgs/mcpx/scripts/tests -v passes (14 tests); the committed-seed CLI emits a finite matrix. Committed-seed and no-seed output match the base implementation byte-for-byte.

Merge Danger

Door: two-way

Blast Radius: low


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@dezren39
dezren39 requested a review from a team as a code owner November 9, 2026 01:14
@coderabbitai

coderabbitai Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 18 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0a0a8e47-c682-4434-8537-bcfd3af98300
Commits

Reviewing files that changed from the base of the PR and between 2ba475c and 56e38ae.

Files selected for processing: 2

  • pkgs/mcpx/scripts/ci/e2e-shard-packer.py
  • pkgs/mcpx/scripts/tests/test_e2e_shard_packer.py
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-14T21:51:07.484896Z
We couldn’t complete this review. Comment @codex review to try again.
56e38ae New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dc84f22fcf

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

6 open issues
What changed in this PR

This PR hardens the e2e shard packer’s timing-seed parsing against malformed inputs (non-object tests, non-finite/non-positive/boolean weights) and adds regression tests to prevent those failures from reoccurring.

Changes:

  • Add _weight_seconds() validation and improve load_weights() fallback/diagnostic notes when seeds are malformed.
  • Skip invalid per-test weights while keeping valid ones and reporting skipped names.
  • Add a new unittest module covering malformed containers, invalid weights, a well-formed seed, and the committed-seed CLI matrix output.
File Description
pkgs/​mcpx/​scripts/​ci/​e2e-shard-packer.py Adds stricter weight validation and clearer fallback behavior/notes when timing seeds are malformed.
pkgs/​mcpx/​scripts/​tests/​test_e2e_shard_packer.py Introduces regression tests for seed parsing edge cases and for the CLI’s emitted GitHub matrix output.

Review effort: Lite

Comment on lines +30 to +33
with tempfile.NamedTemporaryFile(mode="w", suffix=".json") as seed:
json.dump(value, seed)
seed.flush()
return packer.load_weights(seed.name, ["TestA", "TestB"])
Comment on lines +62 to +65
with tempfile.NamedTemporaryFile(mode="w", suffix=".json") as seed:
json.dump(value, seed)
seed.flush()
weights, note = packer.load_weights(seed.name, names)
Comment on lines +86 to +89
with tempfile.NamedTemporaryFile(mode="w", suffix=".json") as seed:
json.dump({"tests": {"TestTrue": True, "TestZero": 0}}, seed)
seed.flush()
weights, note = packer.load_weights(seed.name, names)
Comment on lines +97 to +100
with tempfile.NamedTemporaryFile(mode="w", suffix=".json") as seed:
json.dump({"tests": {"TestA": 12, "TestB": 8}}, seed)
seed.flush()
weights, note = packer.load_weights(seed.name, ["TestA", "TestB", "TestC"])
Comment on lines +122 to +136
with tempfile.NamedTemporaryFile(mode="w+", suffix=".out") as output:
result = subprocess.run(
[
sys.executable, PACKER_PATH,
"--tests-dir", os.path.join(MCPX_DIR, "internal", "e2e"),
"--timings", TIMINGS_PATH,
"--target-seconds", "170",
"--max-shards", "6",
"--github-output", output.name,
],
cwd=REPO_ROOT,
capture_output=True,
text=True,
timeout=60,
)
measured: dict[str, float] = {}
skipped: list[str] = []
if path and os.path.exists(path):
with open(path) as fh:
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@dezren39

Copy link
Copy Markdown
Member Author

agent-note:v1
state: picked-up
task: 17270
lane: code-d
worker: repo-worker-code
What: Shepherding PR #7897 (mcpx(ci): guard malformed e2e timing seeds, refs #6822). Verified fresh: PR OPEN, head ca91de1, no labels / no hard stops; issue #6822 OPEN. The fix is NOT on main: main's e2e-shard-packer.py load_weights is still the unguarded version (no finite/bool weight validation, raw .items() on a possibly non-object tests field). PR is mergeable=false / dirty: it conflicts with main because both sides added pkgs/mcpx/scripts/tests/test_e2e_shard_packer.py with different content (main's version covers Go build-constraint discovery; the PR's covers weight loading).
Next: merge main into the PR branch in a laptop worktree, resolve the test-file conflict by combining both test suites, run the packer tests, push, then merge the PR.

@dezren39 dezren39 added queue/claimed Queue worker lifecycle state status/in-progress Queue worker lifecycle state work/assigned Queue worker lifecycle state labels Nov 14, 2026
…seed-shape-guards

# Conflicts:
#	pkgs/mcpx/scripts/ci/e2e-shard-packer.py
#	pkgs/mcpx/scripts/tests/test_e2e_shard_packer.py
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@dezren39

Copy link
Copy Markdown
Member Author

agent-note:v1
state: merge-ready
task: 17270
lane: code-d
worker: repo-worker-code
What: PR #7897 conflict resolved and verified. Merged current main into the PR branch (merge commit 56e38ae, pushed). Conflicts: (1) e2e-shard-packer.py fallback-note hunk — kept the PR's guarded fallback reason; the rest of load_weights auto-merged, so main now carries the #6822 guard (non-object tests field falls back with a named reason; bool / non-finite / non-positive weights skipped by name). (2) test_e2e_shard_packer.py add/add — combined both suites into one file: the PR's WeightLoadingTest (#6822) plus main's DiscoverBuildConstraintTests (#6906), union imports, single module load. Verification on the merged tree: test_e2e_shard_packer.py 15/15 OK; full pkgs/mcpx/scripts/tests discover 29/29 OK. PR is mergeable=true / clean; checks on the new head complete (CodeRabbit NEUTRAL, dependabot SUCCESS). Codex gate: review on the new head FAILED on Codex account usage limits with zero findings delivered — no finding exists to disposition; merging on local verification per fleet rules (CI runs on main only).
Next: merge PR #7897, verify, complete task 17270.

@dezren39
dezren39 merged commit ff81370 into main Nov 14, 2026
2 checks passed
@dezren39
dezren39 deleted the queue/11046-6822-e2e-seed-shape-guards branch November 14, 2026 21:52
@dezren39 dezren39 removed status/in-progress Queue worker lifecycle state queue/claimed Queue worker lifecycle state work/assigned Queue worker lifecycle state labels Nov 14, 2026
@dezren39

Copy link
Copy Markdown
Member Author

agent-note:v1
state: done
task: 17270
lane: code-d
worker: repo-worker-code
What: PR #7897 MERGED — merge commit ff81370. The #6822 seed-shape guard is on main; issue #6822 is CLOSED with the evidence (all three defects guarded, regression tests in-tree). Conflict resolution and test evidence are in the merge-ready note on this PR.
Next: none — task 17270 completes as fixed_merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants